package com.befirefly.studentmanager.util;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.io.SAXReader;

/**
 * @Author: 八千里路云和月
 * @Date: 2021/2/8 11:28
 * @Description:
 */
public class XMLUtil {

    public static Document getDocument(String filename) {
        String path = XMLUtil.class.getClassLoader().getResource("").getPath();
        SAXReader saxReader = new SAXReader();
        try {
            Document document = saxReader.read(path + "xml/" + filename);
            return document;
        } catch (DocumentException e) {
            e.printStackTrace();
        }
        return null;
    }
}
